<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>对象解构赋值</title>
</head>

<body>
    <div>
        对象的属性没有顺序，解构的时候变量名称必须和属性名字相同才可以取到正确的值,否则结果为undefined
    </div>
    <pre>
        let {proper1,proper2} = {proper1:'chj',proper1:18} // proper1:18  proper2:"chj"

        let {sex} = {gender:'male'}
 </pre
    >
  </body>
</html>
<script>
  let { proper1, proper2 } = { proper2: "chj", proper1: 18 }; // proper1:18  proper2:"chj"
  let { sex } = { gender: "male" }; // sex:undefined
</script>